<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>顺风车 --- 我做主：我的车库管理</title>
<link href="${ctx}/css/myhome-css/home_service_base.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/css/myhome-css/book-manager.css" rel="stylesheet" type="text/css" />

</head>
<body>

    
    <!--右栏开始-->

    <div id="orderList" class="account_right">
      <h2>管理我的物品</h2>
      <h3>可以在这里管理我已经上传的物品，删除、修改、上架/下架。</h3>
      <div class="bookList">
      	<ul class="bookListTitle">
        	<li>商品</li>
            <li>描述</li>
            <li>价格</li>
            <li>上传时间</li>
            <li>操作</li>
        </ul>
        <div class="books">
        	<!--
            <ul>
            	<li>JAVA与模式</li>
            	<li>一件很好的商品</li>
            	<li>￥112.00</li>
            	<li>2009/10/01</li>
            	<li>
                	<a href="#">修改</a>&nbsp;
                    <a href="${ctx}/home/bookManager!delete.action">删除</a>&nbsp;
                    <a href="#">下架</a>&nbsp;
                </li>
            </ul>
        	-->
        	<s:if test="page.pageList !=null">
        	<s:iterator value="page.pageList" status="itStatus">
        	<ul><%--itStatus.index就是取得其序号, itStatus 中有index字段--%>
				<li>&nbsp;<c:out value="${bookName[itStatus.index]}" escapeXml="true"/></li>
				<li>&nbsp;<c:out value="${fn:substring(content,0,7)}" escapeXml="true"/>
					<c:if test="${fn:length(content)>7}">...</c:if>
				</li>
				<li>&nbsp;<c:out value="${price}" escapeXml="true"/></li>
				<li>&nbsp;<s:date name="createTime" format="yyyy'/'M'/'d" /></li>
            	<li>&nbsp;
                	<a href="${ctx}/home/upload-book!input.action?id=${id}">修改</a>&nbsp;
                    <a href="${ctx}/home/book-manager!delete.action?id=${id}" onclick="return wenwen();">删除</a>&nbsp;
                    <s:if test="status == 'unsale'">
                    <a href="${ctx}/home/book-manager!change.action?id=${id}">上架</a>&nbsp;
                    </s:if>
                    <s:elseif test="status == 'onsale'">
                    <a href="${ctx}/home/book-manager!change.action?id=${id}">下架</a>&nbsp;
                    </s:elseif>
                </li>
            </ul>
            </s:iterator>
            </s:if>
            <s:else>
            	<ul><li style="width:400px;">Sorry,你还没发布任何商品！</li></ul>
            </s:else>
        </div>
        <div class="nextPage">
          <n:page actionUrl="${ctx}/home/book-manager.action" sumPages="${page.totalPages}" activePage="${page.currentPage}" pageNoKey="niagara_params_pageNo"/>
      	</div>
      </div>
      
    </div>
    <div class="empty_box"></div>
    <div style="POSITION: absolute" id="tag_box"></div>
    <!--右栏结束-->
<script type="text/javascript">
	function wenwen(){
		var flag = confirm("您确定要删除吗？");
		if(flag){
			return true;
		}else{
			return false;
		}
	}
</script>
</body>
</html>